import axios from '@/libs/api.request'
import qs from 'qs'

// 根据字典码获取字典表
export const getSelectOption = (params) => {
  return axios.request({
    url: 'admins/dataDict/getDictByCode?t='+new Date().getTime(),
    method: 'get',
    params
  })
}
// 新增机组文件
export const AddFile = (data) => {
  return axios.request({
    url: 'admins/fileManager/add',
    method: 'POST',
    data: qs.stringify(data)
  })
}
// 查询机组文件
export const SearchList = (params) => {
  return axios.request({
    url: 'admins/fileManager/page?t='+new Date().getTime(),
    method: 'get',
    params
  })
}
// 删除机组文件
export const DelFile = (data) => {
  return axios.request({
    url: 'admins/fileManager/delete',
    method: 'POST',
    data: qs.stringify(data)
  })
}
// 修改机组文件
export const UpDateFile = (data) => {
  return axios.request({
    url: 'admins/fileManager/edit',
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 搜索文件
export const SearchFile = (params) => {
  return axios.request({
    url: 'admins/fileManager/searchPage?t='+new Date().getTime(),
    method: 'get',
    params
  })
}
//导出
export const downExcel = (params) => {
  return axios.request({
    url: 'admins/fileManager/download?t='+new Date().getTime(),
    method: 'get',
    responseType: 'blob',
    params
  })
}
